import glob
import os
from pathlib import Path

import cv2
import numpy as np
import pandas as pd
from DrissionPage import ChromiumPage, ChromiumOptions
from DrissionPage.common import Actions
from DrissionPage.errors import AlertExistsError
from DrissionPage.common import Keys
import time
from datetime import datetime, timedelta

from dingding import SendFile
from login import login
from page import get_page
from 合并excel import concat_excel_files
from 滑块验证码 import slider_img
import pickle

from 获取无效id import get_wuxiaoid

usernames1 = {'username': 'yexiong1997@qq.com', 'password': 'Yexiong1997', 'port': 9225, 'user_path': r"C:\15867710780",
              'down_path': r"C:\15867710780\filedownloads"}
usernames2 = {'username': '594688317@qq.com', 'password': 'Yh5566789', 'port': 9223, 'user_path': r"C:\594688317",
              'down_path': r"C:\594688317\filedownloads"}
usernames3 = {'username': '791002765@qq.com', 'password': 'yexiong1997Mm', 'port': 9224, 'user_path': r"C:\791002765",
              'down_path': r"C:\791002765\filedownloads"}
usernames4 = {'username': '2968425169@qq.com', 'password': 'yexiong1997Mm', 'port': 9226, 'user_path': r"C:\2968425169",
              'down_path': r"C:\2968425169\filedownloads"}


def getpage(usernames):
    username = usernames['username']
    password = usernames['password']
    port = usernames['port']
    user_path = usernames['user_path']
    downpath = usernames['down_path']
    page = get_page(port, user_path, downpath)
    return page


page = getpage(usernames2)
page.latest_tab